package cz.mzk.lidovky.articles.cli;

import cz.mzk.rehan.commons.CommandLineOptions;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.cli.Option;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Martin Řehánek (rehan at mzk.cz)
 */
public class DefinedOptions implements CommandLineOptions {

    public final Option ACTION = new Option("a", "action", true,
            "Action to be performed");
    public final Option PROPERTIES_FILE = new Option("p", "properties-file", true,
            "Propeties file");
    public final Option TEST = new Option("t", "test", false,
            "Only create files and don't import them");
    public final Option SIMPLIFIED = new Option("s", "simplified-properties", false,
            "There's only need to specify import file "
            + "and output files will be created according to input file's name");
    public final Option DIR_LIST = new Option("d", "dir-list", true,
            "File containint list of directories");
    public final Option PARSER = new Option("parser", "parser", true,
            "Class for parsing input data");
    public final Option UPDATER = new Option("updater", "updater", true,
            "Class for updating datastream data");
    public final Option DATASTREAM_ID = new Option("dsId", "dsId", true,
            "Datastream to be updated");
    public final Option PID_LIST = new Option("pidlist", "pid-list", true,
            "File containint list of pids");
    public final Option SECONDS = new Option("sec", "seconds", true,
            "Number of seconds to wait between the reindexing requests");

    {
        ACTION.setRequired(true);
        PROPERTIES_FILE.setRequired(true);
        TEST.setRequired(false);
        SIMPLIFIED.setRequired(false);
        DIR_LIST.setRequired(false);
        PARSER.setRequired(false);
        UPDATER.setRequired(false);
        DATASTREAM_ID.setRequired(false);
        PID_LIST.setRequired(false);
        SECONDS.setRequired(false);
    }

    @Override
    public List<Option> getAllOptions() {
        List<Option> result = new ArrayList<Option>();
        result.add(ACTION);
        result.add(PROPERTIES_FILE);
        result.add(TEST);
        result.add(SIMPLIFIED);
        result.add(DIR_LIST);
        result.add(PARSER);
        result.add(UPDATER);
        result.add(DATASTREAM_ID);
        result.add(PID_LIST);
        result.add(SECONDS);
        return result;
    }
}
